<?php
namespace app\Admin\controller;
use think\Controller;
use app\Admin\model\Do_login;

    class Login extends Controller
    {
        public function index()
        {
            if(request()->isPost()){
                $do_login=new Do_login();
                $data=input('post.');
                $num=$do_login->index($data);
                if($num==4){
                    return redirect('index/index/index');
                }else if($num==3){
                    return redirect('index/index');
                }else{
                    $this->error('用户名或密码错误');
                }
            }
            return $this->fetch();
        }
    }

?>